package net.zjitc.service;

import net.zjitc.mapper.UserMapper;
import net.zjitc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public User queryUserById(Long id){
        return userMapper.selectByPrimaryKey(id);

    }


    public List<User> queryAllUsers(){
        return userMapper.selectAll();
    }
    public int createUser(User user){
        userMapper.insert(user);
        return 0;
    }
}
